/* 
 * ----------------------------------------------------------------
 * This is the basic interface that handles the game input including 
 * the key event, touch event, and accelerate event 
 * 2011, by Wu Mu Xian
 * ---------------------------------------------------------------- 
*/

package mygame.basicgameframework;

import java.util.List;

public interface Input {
	// the key event
	public static class KeyEvent {
		public static final int KEY_DOWN = 0;
		public static final int KEY_UP = 1;
		
		public int type;
		public int keyCode;
		public char keyChar;	
	}
	
	// the touch event
	public static class TouchEvent {
		public static final int TOUCH_DOWN = 0;
		public static final int TOUCH_UP = 1;
		public static final int TOUCH_DRAGGED = 2;
		
		public int type;
		public int x,y;
		public int pointer;	
	}
	
	// called when a key is pressed
	public boolean isKeyPressed(int keyCode);
	
	// called when the screen is touched
	public boolean isTouchDown(int pointer);
	
	// get the x coordinate of the touch point
	public int getTouchX(int pointer);
	
	// get the y coordinate of the touch point
	public int getTouchY(int pointer);
	
	// get the acceleration of x-axial
	public float getAccelX();
	
	// get the acceleration of y-axial
	public float getAccelY();
	
	// get the acceleration of z-axial
	public float getAccelZ();
	
	// get the key event list
	public List<KeyEvent> getKeyEvents();
	
	// get the touch event list
	public List<TouchEvent> getTouchEvents();
}
